import express, { RequestHandler } from 'express';
import { login, logout, getCurrentUser } from '../controllers/authController';
import authMiddleware from '../middlewares/auth';

const router = express.Router();

router.post('/login', login as unknown as RequestHandler);
router.post('/logout', authMiddleware as unknown as RequestHandler, logout as unknown as RequestHandler);
router.get('/me', authMiddleware as unknown as RequestHandler, getCurrentUser as unknown as RequestHandler);

export default router;